package com.verisette.ncos.persistence.dao;

import java.util.LinkedList;
import java.util.List;

import org.corp.agi.persistence.dao.CommonDAOImpl;

public class HistoryLogDAOImpl  extends CommonDAOImpl implements HistoryLogDAO  {

	public int createHistoryLog(Long recordId) {
		StringBuffer q1 = new StringBuffer();
		List<Object> param = new LinkedList<Object>();
		q1.append("insert into LOG_CUSTOMER_MASTER ");
		q1.append("select * ");
		q1.append("from CUSTOMER_MASTER ");
		q1.append("where RECORD_ID = ? ");
		param.add(recordId);
		return executeNativeSQL(q1.toString(), param.toArray());
	}
	
	public int createHistoryLogFromTemp() {
		StringBuffer q1 = new StringBuffer();
		q1.append("insert into LOG_CUSTOMER_MASTER ");
		q1.append("select * ");
		q1.append("from #temp ");
		q1.append("where group_status in ('S. MASTER','C. MASTER','C') ");
		return executeNativeSQL(q1.toString());
	}
}
